import fs from 'fs'
import path from 'path'
import { ActionFunction, json } from 'remix'

export const action: ActionFunction = async ({ request, params }) => {
    const root = path.join(process.cwd(), 'tasks')
    const files = fs.readdirSync(root)

    return json({ success: true, data: files })
}
